home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
MATHS
/
RLAB
/
RLAB125.ZIP
/
!RLaB
/
examples
/
eval_demo
< prev
next >
Wrap
Text File
|
1994-07-13
|
545b
|
45 lines
//
// The beginning of an eval() demonstration
//
//
// First define two functions for evaluating string matrices.
//
evalm = function ( M )
{
local (m, i)
if (class (M) != "string")
{
error ("evalm: argument must be class string");
}
for (i in 1:M.n)
{
m[i] = eval (M[i]);
}
return m;
};
eval2m = function ( M )
{
local (m)
// The first time
m = evalm (M);
//
// Now do it again if the result
// is all string
//
if (class (m) != "string")
{
return m;
else
return evalm (m);
}
};